﻿/* Write a program to convert decimal numbers to their hexadecimal representation. */

using System;

class DecimalToHex
{
    static void Main()
    {
        int n = Int32.Parse(Console.ReadLine());
        int remainder = n % 16;
        string hex_ch = null;
        while (n != 0)
        {
            switch (remainder)
            {
                case 10: 
                    hex_ch += "a"; 
                    break;
                case 11: 
                    hex_ch += "b"; 
                    break;
                case 12: 
                    hex_ch += "c"; 
                    break;
                case 13: 
                    hex_ch += "d"; 
                    break;
                case 14: 
                    hex_ch += "e"; 
                    break;
                case 15: 
                    hex_ch += "f"; 
                    break;
                default: 
                    hex_ch += remainder; 
                    break;
            }
            n /= 16;
            remainder = n % 16;
        }

        string res = "";

        for (int i = hex_ch.Length; i > 0; i--) res += hex_ch[i - 1];
        
        Console.WriteLine(res);
    }
}
